package xyz.bali16.module.netdisk.service;

import com.gitee.starblues.annotation.Supplier;
import org.springframework.web.multipart.MultipartFile;
import xyz.bali16.application.core.model.Result;
import xyz.bali16.module.netdisk.utils.PageUtils;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author bali2 on 7/11/2021.
 * @version 1.0
 */

@Supplier("netdiskService")
public interface NetdiskService {
    /**
     * 网盘,上传文件接口
     * @param file
     * @return
     */
    @Supplier.Method("uploadFile")
    Result<String> uploadFile(MultipartFile file, String fileUserId, String fileStorageId, String fileFolderId, HttpServletRequest request);

    /**
     * 网盘,下载文件接口
     * @param fileId
     * @param fileStorageId
     * @param fileUserId
     */
    @Supplier.Method("downloadFile")
    void downloadFile(String fileUserId, String fileStorageId, String fileId, HttpServletRequest request,HttpServletResponse response);
    @Supplier.Method("list")
    PageUtils list(String fileStorageId, String fileFolderId, Integer curPage, Integer pageSize) ;
    @Supplier.Method("deleteFile")
    boolean deleteFile(String fileId);

    /**
     * 创建服务口
     * @param serviceId
     * @return
     */
    @Supplier.Method("createService")
    boolean createService(String name,String serviceId);

    /**
     * 判断是否存在服务口
     * @param serviceId
     * @return
     */
    @Supplier.Method("existService")
    boolean existService(String serviceId);
}
